<template>
    <div class="fixed-box">
        <el-checkbox v-model="checked">固定运费</el-checkbox>
        <div style="margin-top: 10px" v-if="checked">
            您设置固定运费后全部订单都将应用此设置
        </div>
        <el-divider></el-divider>
        <el-form
            :model="form"
            ref="form"
            :rules="rules"
            label-width="80px"
            :inline="true"
            size="normal"
        >
            <el-form-item label="固定运费">
                <el-input v-model="form.a">
                    <template slot="append">元/单</template>
                </el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSubmit">保存</el-button>
            </el-form-item>
        </el-form>
        <avue-crud
            :data="data"
            :option="option"
            v-model="obj"
            @row-update="rowUpdate"
        >
            <template slot="menuLeft">
                <el-button
                    v-if="fixed_btn_down"
                    class="filter-item"
                    type="primary"
                    icon="el-icon-plus"
                    @click="chooseProvice"
                    >选择省份
                </el-button>
            </template>
        </avue-crud>
    </div>
</template>

<script>
export default {
    data() {
        return {
            option: {
                page: false,
                align: "center",
                menuAlign: "center",
                cellBtn: true,
                addBtn: false,
                editBtn: false,
                delBtn: false,
                column: [
                    {
                        label: "运送到",
                        prop: "name",
                    },
                    {
                        label: "运费",
                        prop: "sex",
                        cell: true,
                    },
                ],
            },
            checked: true,
            fixed_btn_down: true,
            form: {},
            rules: {},
            obj: {},
            data: [
                {
                    name: "黑龙江",
                    sex: "2",
                },
            ],
        };
    },
    methods: {
        chooseProvice() {},
    },
};
</script>

<style lang="scss" scoped>
.fixed-box {
    padding: 10px 0;
}
</style>